<%@page import="com.entity.Ideal"%>
<%@page import="com.entity.Document"%>
<%@page import="com.entity.Project"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="top.jsp" %>
<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<title>编辑想法</title>

</head>
<body>

	<%
		Ideal ideal=(Ideal)session.getAttribute("ideal");
	 %>

	<div class="container well" style="width:800px">
		<h1>编辑想法</h1>
		
		<div>
			<form action="updateideal.jspx" method="post" id="form" class="form-horizontal well">
						<div class="form-inline">
							<label>标题</label><br>
							<input id="input01"style="height:30px" type="text" value="<%=ideal.getTitle() %>" class="input-xlarge" placeholder="请输入想法名称" name = "idealtitle">
							<span style="color:red" id="input01_msg"></span>
						</div>
						
						<br /><br />
						<label>内容</label>
						<textarea rows="6" id="input02" class="span10"  placeholder="请输入想法的描述" name = "idealcontent"><%=ideal.getContent() %></textarea>
						<span style="color:red" id="input02_msg"></span>
						<br /><br />
				
						<div class="form-actions" style="padding-left:324px">
							<button class="btn btn-primary btn-large" type="submit">保存</button>
							<a class="btn btn-large" href="ideal.jspx">返回</a>
							
						</div>
			</form>
		</div>
	</div>
	<script type="text/javascript">
		document.getElementById("form").onsubmit=function(){
			
			var input01 = document.getElementById("input01").value;
			var input02 = document.getElementById("input02").value;

			if(input01.trim() == "") {
				
				document.getElementById("input01_msg").innerHTML = "请输入想法标题";
				document.getElementById("input01").focus();
				return false;
			}
			if(input02.trim() == "") {
				
				document.getElementById("input02_msg").innerHTML = "请输入想法内容";
				document.getElementById("input02").focus();
				return false;
			}
			
		};
		
		document.getElementById("input01").onblur = function(){
		
			var input01 = document.getElementById("input01").value;
			
			if(input01.trim() == "") {
				document.getElementById("input01").value = "";
				document.getElementById("input01_msg").innerHTML = "请输入想法标题";
				document.getElementById("input01").focus();
			}else{
				document.getElementById("input01_msg").innerHTML = "";
			}
		};
		document.getElementById("input02").onblur = function(){
		
			var input02 = document.getElementById("input02").value;
			if(input02.trim() == "") {
				document.getElementById("input02").value = "";
				document.getElementById("input02_msg").innerHTML = "请输入想法内容";
				document.getElementById("input02").focus();
			}else{
				document.getElementById("input02_msg").innerHTML = "";
			}
		};
		
		document.getElementById("input01").onkeydown = function(){
			
			document.getElementById("input01_msg").innerHTML = "";
		};
		document.getElementById("input02").onkeydown = function(){
			document.getElementById("input02_msg").innerHTML = "";
		};
	</script>
</body>
</html>